#include "Pool.h"


CPool::CPool()
{
	int i;
	CBullet* temporaryBullet;
	// Normal bullet
	for (i = 0; i < 4; i++)
		pool_[0].push_back(new CNormalBullet());

	// M bullet
	for (i = 0; i < 6; i++)
		pool_[1].push_back(new CM0Bullet());

	// F bullet
	for (i = 0; i < 4; i++)
		pool_[2].push_back(new CFBullet());

	// S bullet
	for (i = 0; i < 10; i++)
		pool_[3].push_back(new CSBullet());

	// L bullet
	//for (i = 0; i < 1; i++)
	pool_[4].push_back(new CLBullet());
}


CPool::~CPool()
{
	int i;

	if (pool_[0].size() != 0)
	{
		for (i = 0; i < 4; i++)
		if (pool_[0][i] != NULL)
			delete pool_[0][i];
	}

	if (pool_[1].size() != 0)
	{
		for (i = 0; i < 6; i++)
		if (pool_[1][i] != NULL)
			delete pool_[1][i];
	}

	if (pool_[2].size() != 0)
	{
		for (i = 0; i < 4; i++)
		if (pool_[2][i] != NULL)
			delete pool_[2][i];
	}

	if (pool_[3].size() != 0)
	{
		for (i = 0; i < 10; i++)
		if (pool_[3][i] != NULL)
			delete pool_[3][i];
	}

	if (pool_[0][0] != NULL)
		delete pool_[0][0];

}
